package jcu.ict.profaid;

import java.util.ArrayList;
import java.util.List;

import jcu.ict.profaid.MyAdapter.ViewHolder;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class MyAdapterPhone extends ArrayAdapter<Object> {
	 
	public MyAdapterPhone(Context form_my_subject, int resource,
			int textViewResourceId, List<Object> objects) {
		super(form_my_subject, resource, textViewResourceId, objects);
	}

	@SuppressLint("DefaultLocale")
	@Override
	public View getView(int position, View cv, ViewGroup parent) {
		ViewHolder vh;
		if (cv == null) {
			cv = super.getView(position, cv, parent);
			vh = new ViewHolder();
			vh.kiri = (TextView) cv.findViewById(R.id.txtUp);

			cv.setTag(vh);
		} else {
			vh = (ViewHolder) cv.getTag();
		}
		Object objek = getItem(position);
		@SuppressWarnings("unchecked")
		ArrayList<Object> row = (ArrayList<Object>) objek;
		
		vh.kiri.setText( row.get(0).toString());
		return cv;
	}
	
	class ViewHolder {
		ImageView img;
		TextView kiri;
	}


}
